<!--#include virtual="/app/common/jsLoader.asp" -->
<%
    require('/app/edk/edk.js');
    require('/app/edk/sql.js');
    require('/app/common/common.js');
    require('/deepcms/classic/public/server.js');
%>
<html>
	<head>
		<%=$$.cfg.headTags()%>
		<style type="text/css">
			body{
				background-color:white;
				padding:20px;
			}
			td{
				padding:3px;
			}
			
		</style>
		<link rel="stylesheet" href="/deepcms/classic/public/style.css" type="text/css"/>
	</head>
	<body>
<%
    var 
         isUpdate = !!Request('ID')()
        ,entity   = isUpdate
                    ? $$.sql('SELECT * FROM newsclass WHERE ID={0}'.format(Request('ID')())).rsObj
                    : new Function('return "";');
%>   
        <h1 style="margin:10px;"><%=isUpdate?'更新':'创建'%>新闻<br /></h1>    
		<form id="editForm" method="post" class="edkForm" action ="/app/news/<%=isUpdate?'update':'create'%>/default.asp">
            <table width="100%">
                <tr>
                    <td width="10%"><label for="title">标题 Title：</label></td>
                    <td><input type="text" id="title" class="edk-input-2" style="width:98%;" name="title" value="<%=entity('title')%>" /></td>
                </tr>
                    <td width="10%"><label for="title">ID：</label>
                    </td>
                    <td>
                    <div><%=entity('ID')%></div>
                    </td>
                </tr>
                <tr>
                    <td>日期：</td>
                    <td>
                        <input type="text" class="edk-input-2" value="<%=entity('mediaLogo')%>" style="width:98%;" name="url"  />
                    	<img src="<%=$$.cfg.app_root + entity('mediaLogo')%>" />
                    </td>
                </tr>	
                <tr>
                    <td>URL：</td>
                    <td>
                        <input type="text" class="edk-input-2" value="<%=entity('mediaLogo')%>" style="width:98%;" name="url"  />
                    	<img src="<%=$$.cfg.app_root + entity('mediaLogo')%>" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <br />
                        <%
                        	if(isUpdate){
                        %>
                        <input type="button" onclick="location.href='/app/news/class/delete/?ID=<%=Request('ID')()%>';" value="      删除该分类 Delete      " />
                        <%
                        	}
                        %>
                        <input type="submit" value="      保存 Save      " /> <input type="reset" value="      复位 Reset       " />
                    </td>
                </tr>
            </table>
            <%
            if(isUpdate){
            %>
                <input type="hidden" value="<%=Request('ID')()%>" name="ID" />
            <%
            }
            %>
		</form>
	</body>
</html>
<%
	if(entity.close){
    	entity.close();
	}
	if(entity.activeConnection){
	    entity.activeConnection.close();
	}
%>
